package Endpoint

import (
	"context"
	"github.com/go-kit/kit/endpoint"
	"gokit_shizhan/Services"
)

type Request struct {
	Uid int `json:"uid"`
}
type Response struct {
	Result string `json:"result"`
}

func ServiceEndpointUser(userService Services.IUserService) endpoint.Endpoint {
	return func(ctx context.Context, request interface{}) (response interface{}, err error) {
		r := request.(Request)
		result := userService.GetName(r.Uid)
		return Response{Result: result}, nil
	}
}